home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / maxval.z / maxval
Encoding:
Text File  |  2002-10-03  |  5.5 KB  |  121 lines

  1. MAXVAL(3I)                                            Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      MMAAXXVVAALL - Returns the maximum value in an array
  6.  
  7. SSYYNNOOPPSSIISS
  8.      MMAAXXVVAALL (([AARRRRAAYY==]_a_r_r_a_y [,,[DDIIMM==]_d_i_m] [,,[MMAASSKK==]_m_a_s_k]))
  9.  
  10. IIMMPPLLEEMMEENNTTAATTIIOONN
  11.      UNICOS, UNICOS/mk, IRIX systems
  12.  
  13.      CF90, MIPSpro 7 Fortran 90
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The MMAAXXVVAALL intrinsic function can be used for array reduction.  It
  20.      returns the maximum value of the elements of _a_r_r_a_y along dimension _d_i_m
  21.      corresponding to the true elements of _m_a_s_k.  It accepts the following
  22.      arguments:
  23.  
  24.      _a_r_r_a_y     Must be of type integer or real.  It must not be scalar.
  25.  
  26.      _d_i_m       Must be a scalar integer value in the range 1 <= _d_i_m <= _n,
  27.                where _n is the rank of _a_r_r_a_y.  The corresponding actual
  28.                argument must not be an optional dummy argument.
  29.  
  30.      _m_a_s_k      This optional argument must be of type logical and must be
  31.                conformable with _a_r_r_a_y.
  32.  
  33.      MMAAXXVVAALL is a transformational intrinsic function.  The name of this
  34.      intrinsic cannot be passed as an argument.
  35.  
  36. NNOOTTEESS
  37.      On UNICOS systems, both execution speed and the number of bits used in
  38.      mathematical operations are affected when compiling with
  39.      ff9900 --OO ffaassttiinntt, which is the default setting.  For more information,
  40.      see _C_F_9_0 _C_o_m_m_a_n_d_s _a_n_d _D_i_r_e_c_t_i_v_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l.
  41.  
  42. RREETTUURRNN VVAALLUUEESS
  43.      The result is of the same type as _a_r_r_a_y.  It is scalar if _d_i_m is
  44.      absent or _a_r_r_a_y has rank one.  Otherwise, the result is an array of
  45.      rank _n-1 and of shape
  46.      (_d , _d , ..., _d     , _d     , ..., _d ),
  47.        1   2        _d_i_m-1   _d_i_m+1        _n
  48.      where (_d , _d , ..., _d )
  49.              1   2        _n
  50.      is the shape of _a_r_r_a_y.
  51.  
  52.      The result of MMAAXXVVAALL((_a_r_r_a_y)) has a value equal to the maximum value of
  53.      all the elements of _a_r_r_a_y or has the value of the negative number of
  54.      the largest magnitude supported for numbers of the data type of _a_r_r_a_y
  55.      if _a_r_r_a_y is a zero-sized array.
  56.  
  57.      The result of MMAAXXVVAALL((_a_r_r_a_y,,MMAASSKK==_m_a_s_k) has a value equal to the maximum
  58.      value of all the elements of _a_r_r_a_y corresponding to true elements of
  59.      _m_a_s_k or has the value of the negative number of the largest magnitude
  60.      supported for numbers of the data type of _a_r_r_a_y if there are no true
  61.      elements.
  62.  
  63.      If _a_r_r_a_y has rank one, MMAAXXVVAALL(_a_r_r_a_y,_d_i_m[,,_m_a_s_k]) has a value equal to
  64.      that of MMAAXXVVAALL(_a_r_r_a_y[,,MMAASSKK=_m_a_s_k]).  Otherwise, the value of element
  65.      (_s , _s , ..., _s     , _s     , ..., _s )
  66.        1   2        _d_i_m-1   _d_i_m+1        _n
  67.      of MMAAXXVVAALL(_a_r_r_a_y,_d_i_m[,,_m_a_s_k]) is equal to
  68.      MMAAXXVVAALL(_a_r_r_a_y(_s , _s , ..., _s     , : , _s     , ..., _s )
  69.                    1   2        _d_i_m-1       _d_i_m+1        _n
  70.       [,, MMAASSKK==_m_a_s_k((_s , _s , ..., _s     , : , _s     , ..., _s )]).
  71.                     1   2        _d_i_m-1       _d_i_m+1        _n
  72.  
  73.      On UNICOS and UNICOS/mk systems, MMAAXXVVAALL returns the value of
  74.      --HHUUGGEE((_a_r_r_a_y)) for all zero-sized arrays.  On IRIX systems, MMAAXXVVAALL
  75.      returns the value of --IINNFFIINNIITTYY for real, zero-sized arrays.  A request
  76.      for interpretation of the Fortran 95 standard may change one of these
  77.      return values for a real array in a future release.
  78.  
  79. EEXXAAMMPPLLEESS
  80.      Example 1:  The value of MMAAXXVVAALL(( ((// 11,, 22,, 33 //)) )) is 3.
  81.  
  82.      Example 2:  Assume that C is the array [10,-100,10].  Then
  83.      MMAAXXVVAALL((CC,, MMAASSKK==CC ..LLTT.. 00..00)) finds the maximum of the negative elements
  84.      of C (which is -100) and MMAAXXVVAALL((CC,, MMAASSKK==CC ..GGTT.. 1100)) returns a negative
  85.      number of the largest possible integer because there are no true
  86.      elements using the mask.
  87.  
  88.      Example 3:  Assume that BB is the following array:
  89.  
  90.         | 1 3 5 |
  91.  
  92.         | 2 4 6 |
  93.  
  94.      The following are true:
  95.  
  96.           MMAAXXVVAALL((BB,, DDIIMM==11)) is [2, 4, 6]
  97.  
  98.           MMAAXXVVAALL((BB,, DDIIMM==22)) is [5, 6]
  99.  
  100.           MMAAXXVVAALL((BB)) is 6
  101.  
  102.      Example 4:  Assume that NN is the following array:
  103.  
  104.         | 0 1 2 3 |
  105.  
  106.         | 4 5 6 7 |
  107.  
  108.         | 8 9 0 1 |
  109.  
  110.      The following are true:
  111.  
  112.           MMAAXXVVAALL((NN((22::33,,22::44)),,MMAASSKK==NN((22::33,,22::44))..NNEE..00)) is 9
  113.  
  114.           MMAAXXVVAALL((NN((22::33,,22::44)),,DDIIMM==11,,NN((22::33,,22::44))..NNEE..00)) is [9, 6, 7]
  115.  
  116.           MMAAXXVVAALL((NN((22::33,,22::44)),,DDIIMM==22,,NN((22::33,,22::44))..NNEE..00)) is [7, 9]
  117.  
  118. SSEEEE AALLSSOO
  119.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  120.      man page.
  121.